/**
 * 
 */
package hwchai.oom.logic.operation;

/**
 * @author Administrator
 *
 */
public class CreateUser extends Operation {

	public static final int TYPE_GERNEL = 0x0;
	public static final int TYPE_MANAGER = 0x1;
	public static final int TYPE_DIRECTOR_PERSONAL = 0x2;
	public static final int TYPE_DIRECTOR_ENTERPRISE = 0x3;
	public static final int TYPE_ADMINSTRATOR = 0x4;
	public static final int TYPE_NETWORK = 0x5;
	
	public static final String NETWORK_PASSWORD = "000000";
	
	protected int type;
	protected String name;
	protected String password;
	/**
	 * @param uid
	 * @param cid
	 */
	public CreateUser(Long uid, int type, String name, String password) {
		super(uid, Long.valueOf(0));
		if(uid == null)
			throw new NullPointerException("uid = null");
		if(name == null)
			throw new NullPointerException("name = null");
		if(type != TYPE_NETWORK && password == null)
			throw new NullPointerException("password = null");
		if(type < TYPE_GERNEL || type > TYPE_NETWORK)
			throw new IllegalArgumentException("type is invalid");
		this.type = type;
		this.name = name;
		this.password = password;
	}

	protected void onCreateUser(){
		
	}
	
	/* (non-Javadoc)
	 * @see hwchai.oom.logic.operation.Operation#onExecute()
	 */
	@Override
	protected void onExecute() {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see hwchai.oom.logic.operation.Operation#onFinished()
	 */
	@Override
	protected void onFinished() {
		// TODO Auto-generated method stub

	}

}
